export default function lookup(keyName, data) {
    let keys = keyName.split('.')

    for(let i = 0; i < keys.length; i++) {
        data = data[keys[i]]
        
        if(data === undefined) {
            throw(new Error(`myTemplate: ${keys[i]} undefined`))
        }
    }

    return data
}